<template>
    <div class="main-container">
        <div style="background-color: #fff;height:100%" id="ParameterDictionary">
            <a-tabs   :lazy-load="true" type="card" @change="tabsChange" justify>
                <a-tab-pane title="字典类别管理" key="1">
                    <div style="height: 100%;">
                        <DictionaryCategory></DictionaryCategory>
                    </div>
                </a-tab-pane>
                <a-tab-pane title="字典明细管理" key="2">
                    <div style="height: 100%;">
                        <DictionaryDetails></DictionaryDetails>
                    </div>
                </a-tab-pane>

            </a-tabs>
        </div>

    </div>
</template>

<script lang="ts">

import { defineComponent, reactive, ref } from 'vue'
import emitter from '@/hooks/useEventBus'
import DictionaryCategory from '@/components/product/ParameterDictionary/DictionaryCategory.vue'
import DictionaryDetails from '@/components/product/ParameterDictionary/DictionaryDetails.vue'

export default defineComponent({
    name: 'ParameterDictionary',
    components: {
        DictionaryDetails,
        DictionaryCategory
    },
    setup() {

        const pageData = reactive({
            tableIndex: "1"
        })


        const tabsChange = (e: string | number) => {
            emitter.emit('window-change')
             if(e==='1'){
                emitter.emit('refresh-DictionaryCategory')
            }else{
                emitter.emit('refresh-DictionaryDetails')
            }
        }
        return {
            pageData,
            tabsChange
        }
    }
})
</script>
<style scoped>
.main-container {
    height: 100%;
}

:deep(.ag-cell) {
    border-right: 1px solid #dde2eb;
}

:deep(.ag-header-cell) {
    border-right: 1px solid #dde2eb;
}
:deep(.ag-cell-value) {
  user-select: initial;
  -moz-user-select: text;
  -ms-user-select: text;
  -webkit-user-select: text;
}
</style>